@extends('layouts.layouts')
@section('title')
    <title>用户列表</title>
    <link rel="stylesheet" href="/css/xadmin.css">


@endsection
@section('content')

<div class="content">
        <div class="header">       
            <h1 class="page-title">课程分类列表</h1>
             <ul class="breadcrumb"></ul>
        </div>
        <div class="main-content">
<div class="btn-toolbar list-toolbar">
    <a href="javascript:;" onclick="window.history.go(-1);"><button class="btn btn-primary">返回</button></a>

  <div class="btn-group">
  </div>
</div>
 <div class="panel panel-default">
   <div class="panel-heading no-collapse">{{$title->title}}(共<?php echo $count = count($data);?>个)<!-- <span class="label label-warning">+10</span> table-bordered --></div>

         <table class="layui-table layui-form">
             <thead>
             <tr>
                <th>编号</th>
                <th>课程名称</th>
                <th>等级</th>
                <th>是否付费</th>
                <th>学院</th>
                <th>导师</th>
                <th>编辑时间</th>
             </thead>
             <tbody class="x-cate">
            @if($count > 0 )
            @foreach($data as $k)
             <tr>
                    <td>{{$k['id']}}</td>
                    <td>{{$k['title']}}</td>
                    <td>{{$k['level']}}</td>
                    <td>{{$k['is_free'] == 1?"免费":"收费"}}</td>
                    <?php
                        $xueyuan = DB::table("course_type")->where("id",$k['course_type_id'])->select("title")->first();
                    ?>
                    <td>{{$xueyuan->title}}</td>
                    <td>{{getUserName($k['user_id'])->name}}</td>
                    <td>{{$k['updated_at']}}</td> 

             </tr>
            @endforeach
            @else
                <tr>
                    <td colspan="7" style="text-align:center;">没有课程喵~</td>
                 </tr>
            @endif
           
             </tbody>
         </table>


</div>


</div>



@endsection
